home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / DBVGAL17.ARJ / VESA.H < prev    next >
C/C++ Source or Header  |  1992-01-25  |  4KB  |  128 lines

  1. /* vesa.h */
  2. #ifndef __VESALIB__
  3. #define __VESALIB__
  4.  
  5. #ifndef __VIDLIB__
  6.       unsigned int  _screen_width;
  7.       unsigned int  _screen_length;
  8.       char *_screen_start;
  9. #endif
  10.  
  11. struct    vesainfo {
  12.     char    signature[4];   /* shoud be "VESA" */
  13.         int     version;
  14.     char *OEMinfo;
  15.     char    capabilities[4];
  16.     int *modeptr;
  17.     char    Reserved[246];
  18. };
  19.  
  20.  
  21. struct    vesamodeinfo {
  22.     int    modeattr;
  23.     char    WindowAattr;
  24.     char    WindowBattr;
  25.     int    granularity;
  26.     int    size;
  27.     int    Asegment;
  28.     int    Bsegment;
  29.     void    (*Windowsetptr)();
  30.     int    bytesperline;
  31.  
  32.     /* optional information (when bit 1 of modeattr is set)    */
  33.  
  34.     int    XPixels;
  35.     int    YPixels;
  36.     char    charwidth;
  37.     char    charlength;
  38.     char    planes;
  39.     char    bits;
  40.     char    banks;
  41.     char    memorymodel;
  42.     char    banksize;               /* in k bytes */
  43.     char    Reserved[246];
  44. };
  45.  
  46. #ifdef VESA
  47. struct          vesainfo   Vinfo;
  48. struct      vesamodeinfo   Vminfo;
  49.             unsigned int   vesapage=0;
  50.         unsigned int   Vnext_break_row;
  51.         unsigned int   Vnext_break_col;
  52.         unsigned long  _window_size;
  53. #else
  54. extern   struct vesainfo   Vinfo;
  55. extern struct vesamodeinfo Vminfo;
  56. extern        unsigned int vesapage;
  57. extern        unsigned int Vnext_break_row;
  58. extern        unsigned int Vnext_break_col;
  59. extern       unsigned long _window_size;
  60. #endif
  61.  
  62. /* included for compatibility with previous version of this library */
  63. #define VESAfirst_page(r,c)     (VESAwhat_page(r,c))
  64. #define VESApage_offset(r,c)    (VESAwhat_offset(r,c))
  65. #define Vnext_break        (Vnext_break_row)
  66. #define Vnext_break_offset    (Vnext_break_offset)
  67.  
  68. #define Vabsolute_offset(r,c)  (((long)(r)*(long)Vminfo.bytesperline)+(c))
  69. #define VESAwhat_page(r,c)   ((int)(Vabsolute_offset(r,c)/_window_size))
  70. #define VESAwhat_offset(r,c) ((int)(Vabsolute_offset(r,c)%_window_size))
  71.  
  72.  
  73. /* If compiling under TurboC++, make sure it knows how to link. */
  74. #ifdef _cplusplus
  75. extern "C" {
  76. #endif
  77.  
  78. int              VESAmode(unsigned int mode, char *palette);
  79. int              isVESA(void);           /* 1=VESA ok., 0=no VESA */
  80. int              isVESAmode(int mode);   /* see if a VESA mode is valid */
  81. struct vesainfo *getVESAinfo(int mode);
  82.  
  83. void             VESAnext_break(void);
  84. /* used by setpages to set Vnext_break_row and Vnext_break_col variables */
  85.  
  86. int              VESAsetpage(unsigned page);
  87. int              VESAsetpagew(char window, unsigned page);
  88. int              VESAsetpagewbios(char window, unsigned page);
  89.  
  90. int              VESAfill256(unsigned dx, unsigned dy,
  91.                  unsigned sdx, unsigned sdy,
  92.                  unsigned color);
  93.          /* video to video copy */
  94. int              VESAcopy256(unsigned dx, unsigned dy,
  95.                  unsigned sx, unsigned sy,
  96.                  unsigned sdx, unsigned sdy);
  97. int              VESAcopy16(unsigned dx, unsigned dy,
  98.                 unsigned sx, unsigned sy,
  99.                 unsigned sdx, unsigned sdy);
  100.  
  101.          /* System memory to video copy */
  102. int              VESAdisp256(unsigned dx, unsigned dy,
  103.                  char *s, unsigned sw, unsigned sl,
  104.                  unsigned sx, unsigned sy,
  105.                  unsigned sdx, unsigned sdy, int direction);
  106. int              VESAdisp16(unsigned dx, unsigned dy,
  107.                 char *s, unsigned sw, unsigned sl,
  108.                 unsigned sx, unsigned sy,
  109.                 unsigned sdx, unsigned sdy);
  110.  
  111.          /* Video to System memory copy */
  112. int              VESAcapt256(char *d, unsigned dw, unsigned dl,
  113.                  unsigned dx, unsigned dy,
  114.                  unsigned sx, unsigned sy,
  115.                  unsigned sdx, unsigned sdy, int direction);
  116.  
  117. int              VESAcapt16(char *d, unsigned dw, unsigned dl,
  118.                 unsigned dx, unsigned dy,
  119.                 unsigned sx, unsigned sy,
  120.                 unsigned sdx, unsigned sdy);
  121.  
  122. #ifdef _cplusplus
  123. }
  124. #endif
  125.  
  126.  
  127.  
  128. #endif